home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / BFED.10 / SEND.C < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-23  |  3.7 KB  |  158 lines

  1. /*
  2.     file: search.c
  3.     utility:
  4.     date: 1989
  5.     author: Jim Charlton
  6.     modifications:
  7.         1995: C. Moreau: 
  8.     comments: 
  9. */
  10. #include <stdio.h>
  11.  
  12. #ifdef __PUREC__ 
  13. #include <aes.h>
  14. #include <compend.h>
  15. #else
  16. #include <aesbind.h>
  17. #endif
  18.  
  19. #include "events.h"
  20. #include "send.h"
  21. #include "wind.h"
  22. #include "main.c"
  23.  
  24. /*
  25.     name: send_vslid
  26.     utility: send application slider message
  27.     comment: 
  28.     parameters:
  29.     return:
  30.     date: 1989
  31.     author: Jim Charlton
  32.     modifications:
  33.         1995: C. Moreau: 
  34. */
  35. void send_vslid(windowptr    thewin)
  36. {  
  37.     if (!slid_flag) /* return if there is already a vslid message pending    */
  38.     {
  39.         message[0] = WM_VSLID;          /* message type is vslid */ 
  40.         message[1] = gl_apid;             /* application id*/ 
  41.         message[2] = 0;                     /* message is standard 16 bytes */ 
  42.         message[3] = thewin->handle;          /* handle of window to refresh */ 
  43.         message[4] = thewin->vslidepos;         /* position of vslider */ 
  44.     
  45.         appl_write( gl_apid, 16, message ); 
  46.         slid_flag = TRUE;
  47.     }
  48. }
  49.  
  50. /*
  51.     name: send_redraw
  52.     utility: send application a redraw message
  53.     comment:  This will send a redraw to your own application.
  54.         The above routine is taken from COMPUTES Technical Reference
  55.         Guide for the Atari ST - Volume 2 AES. Have fun. 
  56.     parameters:
  57.     return:
  58.     date: 1989
  59.     author: Jim Charlton
  60.     modifications:
  61.         1995: C. Moreau: 
  62. */
  63. void send_redraw(windowptr    thewin)
  64. {  
  65.     if (!draw_flag) /* return if there is already a draw message pending    */
  66.      {
  67.               /* the message buffer */ 
  68.         message[0] = WM_REDRAW;          /* message type is redw */ 
  69.         message[1] = gl_apid;             /* application id*/ 
  70.         message[2] = 0;                     /* message is standard 16 bytes */ 
  71.         message[3] = thewin->handle;          /* handle of window to refresh */ 
  72.         message[4] = thewin->work.g_x;                /* position and size of redraw */ 
  73.         message[5] = thewin->work.g_y; 
  74.         message[6] = thewin->work.g_w; 
  75.         message[7] = thewin->work.g_h; 
  76.     
  77.         appl_write( gl_apid, 16, message ); 
  78.         draw_flag = TRUE;
  79.     }  
  80. }
  81.  
  82. /*
  83.     name: immed_redraw
  84.     utility: bypass event multi and do a screen redraw
  85.     comment: 
  86.     parameters:
  87.     return:
  88.     date: 1989
  89.     author: Jim Charlton
  90.     modifications:
  91.         1995: C. Moreau: 
  92. */
  93. void immed_redraw(windowptr thewin)
  94. {
  95.       /* the message buffer */ 
  96.     message[0] = WM_REDRAW;          /* message type is redw */ 
  97.     message[1] = gl_apid;             /* application id*/ 
  98.     message[2] = 0;                     /* message is standard 16 bytes */ 
  99.     message[3] = thewin->handle;          /* handle of window to refresh */ 
  100.     message[4] = thewin->work.g_x;        /* position and size of redraw */ 
  101.     message[5] = thewin->work.g_y; 
  102.     message[6] = thewin->work.g_w; 
  103.     message[7] = thewin->work.g_h; 
  104.     window_do(message);
  105. }
  106.  
  107. /*
  108.     name: send_arrow
  109.     utility: send application an arrow message
  110.     comment: 
  111.     parameters:
  112.     return:
  113.     date: 1989
  114.     author: Jim Charlton
  115.     modifications:
  116.         1995: C. Moreau: 
  117. */
  118. void send_arrow(windowptr    thewin,int    direction)
  119. {  
  120.     if (!arro_flag)/* return if there is already a arrow message pending    */
  121.     {
  122.           /* the message buffer */
  123.         message[0] = WM_ARROWED;          /* message type is */ 
  124.         message[1] = gl_apid;             /* application id*/ 
  125.         message[2] = 0;                     /* message is standard 16 bytes */ 
  126.         message[3] = thewin->handle;          /* handle of window to refresh */ 
  127.         message[4] = direction;                /* up = 2, down = 3 */ 
  128.         message[5] = 0;
  129.         message[6] = 0; 
  130.         message[7] = 0; 
  131.     
  132.         appl_write( gl_apid, 16, message ); 
  133.         arro_flag = TRUE;
  134.     }
  135. }
  136.  
  137. /*
  138.     name: send_redraw_all
  139.     utility: send a redraw to all windows
  140.     comment: 
  141.     parameters:
  142.     return:
  143.     date: 1989
  144.     author: Jim Charlton
  145.     modifications:
  146.         1995: C. Moreau: 
  147. */
  148. void send_redraw_all(void)
  149. {
  150.     windowptr thewindow = firstwindow;
  151.  
  152.     while (thewindow)
  153.     {
  154.         immed_redraw(thewindow);
  155.         thewindow = thewindow->next;
  156.     }
  157. }
  158.